FROM python:3.9.5
WORKDIR /app/
ADD sources.list /etc/apt/
RUN echo "Install Mariadb" \
    && wget https://pan.ray0728.cn/MyDAV/resources/mariadb/mariadb_repo_setup\
    && echo "6083ef1974d11f49d42ae668fb9d513f7dc2c6276ffa47caed488c4b47268593 mariadb_repo_setup"    | sha256sum -c - \
    && chmod +x mariadb_repo_setup \
    && ./mariadb_repo_setup --skip-maxscale\
    && sed -i 's/https:\/\/dlm.mariadb.com\/repo\/mariadb-server\/11.rolling\/repo/https:\/\/mirrors.aliyun.com\/mariadb\/repo\/11.rolling/g' /etc/apt/sources.list.d/mariadb.list \
    && echo "\n\nUpdate System" \
    && apt update \
    && apt -y upgrade \
    && echo "\n\nInstall dependency files" \
    && apt install -y --fix-missing netcat-openbsd cron tesseract-ocr python-pil python-opencv libmariadb3 libmariadb-dev ffmpeg\
    && echo "\n\nUpdate python" \
    && pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ \
    && pip install --upgrade pip \
    && rm ./mariadb_repo_setup
